#pragma once

class Sample;
class CttsInstance;
class CttsVoice;
class ModulatorTextProvider;

class LoqModulatorStream
{
public:
	LoqModulatorStream(void);
	~LoqModulatorStream(void);

	void Initialize(ModulatorTextProvider* textProvider);
	void Reset();
	Sample* GetData();
	void PutData(void* lData, unsigned int nBytes);

	void AddLastSample();//public for convenience in callback only

private:
	CttsInstance* instance;
	CttsVoice* voice;
	ModulatorTextProvider* textProvider;

	int sampleIdx;
	Sample* lastSample;
	char* modulatorText;
	void NextSample(short* sData, unsigned int nBytes, int* dataIdx);
	void Next48KhzSample(short* sData, unsigned int nBytes, int* dataIdx);


};
